<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<!DOCTYPE HTML>
<html>
<head>
<?php if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 8.0") || strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 9.0")){?>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<?php } ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="<?php echo(Yii::app()->params['app']['host'].Yii::app()->params['app']['logoSmall']);?>" />
<meta http-equiv="pragma" content="no-cache" />
<title><?php echo(Yii::app()->params['app']['name'])?> - <?php echo(Yii::app()->params['app']['title'])?></title>
<meta name="Keywords" content="云盘,<?php echo(Yii::app()->params['app']['name'])?>,<?php echo(Yii::app()->params['app']['name'])?>网络U盘,免费云盘,免费网络硬盘,网络存储空间,云计算,云存储,下载" />
<meta name="Description" content="<?php echo(Yii::app()->params['app']['name'])?>是<?php echo(Yii::app()->params['app']['company'])?>推出的具有存储容量大、免费、高速、稳定、易用，安全等特点的免费网络硬盘，即免费网络存储空间服务。" />
<link href="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/css/frame_top.css?v=<?php echo(Yii::app()->params['app']['version'])?>" rel="stylesheet" type="text/css" />
<link href="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/css/directory_tree.css?v=<?php echo(Yii::app()->params['app']['version'])?>" rel="stylesheet" type="text/css" />
<link href="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/css/default.css?v=<?php echo(Yii::app()->params['app']['version'])?>" rel="stylesheet" type="text/css" />
<script type="text/javascript">document.domain = window.location.host;</script>
<script type="text/javascript" src="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/js/jquery.js?v=<?php echo(Yii::app()->params['app']['version'])?>" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/js/util.js?v=<?php echo(Yii::app()->params['app']['version'])?>" charset="utf-8"></script>


<style type="text/css">
#SWFUpload_Console{ position:absolute; z-index: 99999;}
.logo {
    float: left;
    height: 80px;
    margin-left: 50px;
    width: 80px;
}
</style>

<script type="text/javascript">
    if (window != top){
        top.location.href = "<?php echo(Yii::app()->params['app']['host'])?>/index.php?r=netdisk/index";
    }
    var APPLICATION = "<?php echo(Yii::app()->params['app']['host'])?>";
    //加载目录数据
    var SCREEN_PARAM = {width: window.screen.width - 380, height:window.screen.height - 130};
    SCREEN_PARAM.page_count = Math.floor(SCREEN_PARAM.width / 134) * (Math.floor(SCREEN_PARAM.height / 165) + 1);
    SCREEN_PARAM.page_count = SCREEN_PARAM.page_count>0?SCREEN_PARAM.page_count:10;

    var PAGE_PATHS = {MY: "<?php echo(Yii::app()->params['app']['host'])?>", MY_OS: "http://webos.my.miniyun.com", PASSPORT: "http://passport.miniyun.com", WAN: "http://wan.miniyun.com", Q: "http://q.miniyun.com", MSG:"http://msg.miniyun.com", U: "http://web.kuyibao.com", VIP: "http://vip.miniyun.com", HOME: "http://home.miniyun.com", DOWNLOAD: "<?php echo(Yii::app()->params['app']['host'])?>/index.php?r=site/download", ACCOUNT: "<?php echo(Yii::app()->params['app']['host'])?>/index.php?r=setting/index", FAVORITE: "<?php echo(Yii::app()->params['app']['host'])?>/index.php?r=list/index&ct=file&ac=userfile&aid=31&cid=0&tpl=list_pg&limit=45"};

    //加载配置数据
    var UPLOAD_CONFIG = {"1":{"aid":1,"upload_url":"<?php echo(Yii::app()->params['app']['host'])?>/index.php?r=netdisk/upload","upload_type_limit":"*","upload_size_limit":<?php echo(Yii::app()->params['app']['uploadSize'])?>,"session_id":"<?php echo Yii::app()->session->sessionID?>"},"upload_share_time":"31\u5929","upload_onoff":1,"upload_onoff_tip":"\u4e0a\u4f20\u7ef4\u62a4\u4e2d\uff0c\u8bf7\u7a0d\u540e\u518d\u4e0a\u4f20\u3002"};

    var USER_COOKIE = '%0D%02T_TP%04%0C%12r%0DGwV%13s%0B%1D%23%5D%1C%0Cp%40%0B%26G%20VD%01p%10uQC%23U%14%0Fu%12y%27%0CQ%05%00%0A%08VP%0F%07s%14CK%01%0A%0E%5B%09%00%07%04QSQP%04%01%0D%0E%5CT%04WTVQ%0F%05%05%0D%00%02RSS%03%03SP%5E%0B%03%04SWUP%04%01Q';
    var USER_COOKIE_LB = 'JTBEJTAyVF9UUCUwNCUwQyUxMnIlMERHd1YlMTNzJTBCJTFEJTIzJTVEJTFDJTBDcCU0MCUwQiUyNkclMjBWRCUwMXAlMTB1UUMlMjNVJTE0JTBGdSUxMnklMjclMENRJTA1JTAwJTBBJTA4VlAlMEYlMDdzJTE0Q0slMDElMEElMEUlNUIlMDklMDAlMDclMDRRU1FQJTA0JTAxJTBEJTBFJTVDVCUwNFdUVlElMEYlMDUlMDUlMEQlMDAlMDJSU1MlMDMlMDNTUCU1RSUwQiUwMyUwNFNXVVAlMDQlMDFR';

    var USER_ID = '';
    //用户权限
    var USER_PERMISSION = {
        is_vip: 1,
        is_vip_exp: Number('0'),
        is_vip_exp_limit: Number("0"),
        share_dir: '1|2|9|',
        lock_dir: 1,
        lock_file: 1
    }
    //加载空间数据
    var SPACE_DATA = eval('({"1":{"size_total_extend":0,"upload_size_limit":"1073741824","size_used":<?php echo $usedSpace?>,"size_total_vip":0,"size_total_base":<?php echo $totalSpace?>,"size_total":<?php echo $totalSpace?>,"size_remain":<?php echo $totalSpace-$usedSpace?>,"size_used_percent":<?php echo $usedSpace/$totalSpace?>}})');
    var PAGE_VIP_URL = '<?php echo(Yii::app()->params['app']['host'])?>/vip';
    var PAGE_VIP_SPACE_URL = '<?php echo(Yii::app()->params['app']['host'])?>/space';
    
    var CONFIG_PHOTO_TEST = true;
    var PAGE_HELP_KEYS = {};
    // 站点名称
    var APP_NAME = '<?php echo(Yii::app()->params['app']['name'])?>';
</script>
<script type="text/javascript" src="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/js/core.js?v=<?php echo(Yii::app()->params['app']['version'])?>" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/js/main_ctl.js?v=<?php echo(Yii::app()->params['app']['version'])?>" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo(Yii::app()->params['app']['host'])?>/statics/web/js/extends.js?v=<?php echo(Yii::app()->params['app']['version'])?>" charset="utf-8"></script>

<script type="text/javascript">
    Core.CONFIG.TUpUserC = true;    //是否使用新版IE OCX上传
    Core.CONFIG.IsWindows = true;
    
    Core.FilePermission.Set(USER_PERMISSION);
    
    Core.CONFIG.TUploadServer = "<?php echo(Yii::app()->params['app']['host'])?>/index.php?r=netdisk/upload";	//上传调度服务器
	Core.CONFIG.TDeleteServer = "";	//上传删除文件服务器
    
    
    if(Core.CONFIG.IsWindows){
        var uploadType = '0';
        Core.CONFIG.UpEngine = 1;
        Core.CONFIG.TUpSp = uploadType;
    }
    else{
        Core.CONFIG.UpEngine = 0;
    }
	
	var MainDefaultTab = '<?php echo $page?>';
/**
    //设置默认tab
    var MainDefaultTab = '';
    if(MainDefaultTab != ""){
        MainDefaultTab = '';
        switch(MainDefaultTab){
            case "q":
                Util.Cookie.set("cache_q_url", "");
                break;
            case "my":
                Util.Cookie.set("cache_my_url", "");
            case "wan":
                Util.Cookie.set("cache_wan_url", "");
        }
    }
    else{
        MainDefaultTab = "u";
        MainDefaultTab = Util.Cookie.get("cache_index_tab");
        
        if(!MainDefaultTab){
            MainDefaultTab = "u";
        }
    }
	**/
</script>
</head>

<body>
<div class="frame-top" style="z-index:99;">
<div class="header"><div class="header_bg2"><div class="logo"><img src="<?php echo(Yii::app()->params['app']['host'].Yii::app()->params['app']['logo']);?>"  height="99px" /></div>	 
  <div class="name">
      <span class="name1"><span class="name2">欢迎光临！<?php echo($nick);?> 
      <?php if($isAdmin){?>
        <span class="manager"><a href="<?php echo(Yii::app()->createUrl("adminControlPanel/index"));?>">管理后台</a></span></span>
      <?php }?>
      </span>
      
        
       
  </div>

     <div class="topnav">
	      <ul id="js_frame_nav_top">
		      <li id="topnav1"><a t="u" onclick="URL_CTL.MyFile(); return false;"><span>我的文件</span></a></li>
		      <li id="topnav2"><a t="favorite" onclick="URL_CTL.Favorite();return false;"><span>我的最爱</span></a></li>
		      <li id="topnav3"><a t="account" onclick="URL_CTL.Account();return false;"><span>帐户管理</span></a></li>
		      <li id="topnav4"><a t="downLoad" onclick="URL_CTL.DownLoad();return false;"><span>下载客户端</span></a></li>
		  </ul>
	 </div>

	 <div class="logout"><a href="<?php echo(Yii::app()->createUrl("site/logout"));?>">退出</a></div><!-- logout -->
	 <div class="GB" id="js_space_box_top">   
	      <div class="gb_line"><div class="gb_line2 <?php if ($per>80){echo "red-status";}?>" style="width:<?php echo($per<100?$per:100)?>%" rel='space_line'></div></div>
		  <p rel='space_text'><?php echo($usedSpaceText)?>/<?php echo($totalSpaceText)?></p>
	 </div>
</div></div>
</div>

<div class="frame-container" id="js_frame_contain">
    <script type="text/javascript">
        var root = "<?php echo(Yii::app()->params['app']['host'])?>/statics/web/images/";
        try{
            Core.SpaceData.SetData(SPACE_DATA);
        }catch(e){}
        
        var html = [];
        var addNodeHtml = '';
        var _left_menu_html = '<div class="col-side leftspan" id="js_side_main_box">'+
                                '<div class="leftnav" id="js_left_side_box">'+
                                    '<ol id="js_tree_box">'+
                                    '<li><a href="javascript:;" aid="1" onclick="URL_CTL.GOTO(1, 0);return false;"><img border="0" src="'+root+'file.gif"/>我的<?php echo(Yii::app()->params['app']['name'])?></a></li>'+
                                    '<li><a href="javascript:;" aid="2" onclick="URL_CTL.GOTO(2, 0);return false;"><img border="0" src="'+root+'document.gif"/>文档</a></li>'+
                                    '<li><a href="javascript:;" aid="3" onclick="URL_CTL.GOTO(3, -1);return false;"><img border="0" src="'+root+'photo.gif"/>相册</a></li>'+
                                    '<li><a href="javascript:;" aid="4" onclick="URL_CTL.GOTO(4, 0);return false;"><img border="0" src="'+root+'music.gif"/>音乐</a></li>'+
                                    '<li><a href="javascript:;" aid="9" onclick="URL_CTL.GOTO(9, 0);return false;"><img border="0" src="'+root+'video.gif"/>视频</a></li>'+ addNodeHtml +
                                    '</ol>'+
                                '</div>'+
                        		'<div class="leftblock">'+
                    			'<div class="leftblock2">'+
                    			 '<dl id="js_left_bottom_box" class="">'+
                    				'<dt></dt>'+
                    				 '<dd onclick="URL_CTL.GOTO(31, 0);return false;" aid="31"><a href="#"><img border="0" src="'+root+'favorite.gif"/><br/>我的最爱</a></dd>'+
                    				 '<dd onclick="URL_CTL.GOTO(35, 0);return false;" aid="35"><a href="#"><img width="37px" border="0" src="'+root+'location.png"/><br/>相册地点</a></dd>'+
                    				 '<dd onclick="URL_CTL.GOTO(32, 0);return false;" aid="32"><a href="#"><img width="37px"  border="0" src="'+root+'recent.gif"/><br/>最新上传</a></dd>'+
                    				 '<dd onclick="URL_CTL.GOTO(7, 0);return false;" aid="7"><a href="#"><img border="0" src="'+root+'recycle.gif"/><br/>回收站</a><b id="js_recycle_count" style="display:none;"></b></dd>'+
                    				 
                    			 '</dl>'+
                    			 '<div class="clear"></div>'+
                    		'</div></div>'+
                            '</div>';
        switch(MainDefaultTab){
            case "app":
                html.push('<div class="frame-main" style="display:none;" id="js_frame_box">' + _left_menu_html + '<div class="col-frame"><iframe src="" frameborder="0" not_url="1" id="js_iframe_list"></iframe></div></div>');
                html.push('<iframe src="?ac=app" frameborder="0" id="js_add_frame_box"></iframe>');
                html.push('<iframe src="" frameborder="0" id="js_other_frame_box" not_url="1" style="display:none;"></iframe>');
                break;
            case "q":
                var cache_gurl = Util.Cookie.get("cache_q_url");
                if(!cache_gurl){
                    cache_gurl = 'http://q.miniyun.com';
                }
                URL_CTL._cache.OldOtherKey = "q";
                
                html.push('<div class="frame-main" style="display:none;" id="js_frame_box">' + _left_menu_html + '<div class="col-frame"><iframe src="" frameborder="0" not_url="1" id="js_iframe_list"></iframe></div></div>');
                html.push('<iframe src="" frameborder="0" id="js_add_frame_box" style="display:none;" not_url="1"></iframe>');
                html.push('<iframe src="'+cache_gurl+'" frameborder="0" id="js_other_frame_box"></iframe>');
                break;
            case "my":
                var cache_gurl = Util.Cookie.get("cache_my_url");
                if(!cache_gurl){
                    cache_gurl = 'http://my.miniyun.com/?ct=friend&type=manage';
                }
                URL_CTL._cache.OldOtherKey = "my";
                
                html.push('<div class="frame-main" style="display:none;" id="js_frame_box">' + _left_menu_html + '<div class="col-frame"><iframe src="" frameborder="0" not_url="1" id="js_iframe_list"></iframe></div></div>');
                html.push('<iframe src="" frameborder="0" id="js_add_frame_box" style="display:none;" not_url="1"></iframe>');
                html.push('<iframe src="'+cache_gurl+'" frameborder="0" id="js_other_frame_box"></iframe>');
                break;
            case "wan":
                var cache_gurl = Util.Cookie.get("cache_wan_url");
                if(!cache_gurl){
                    cache_gurl = 'http://wan.miniyun.com';
                }
                URL_CTL._cache.OldOtherKey = "wan";
                
                html.push('<div class="frame-main" style="display:none;" id="js_frame_box">' + _left_menu_html + '<div class="col-frame"><iframe src="" frameborder="0" not_url="1" id="js_iframe_list"></iframe></div></div>');
                html.push('<iframe src="" frameborder="0" id="js_add_frame_box" style="display:none;" not_url="1"></iframe>');
                html.push('<iframe src="'+cache_gurl+'" frameborder="0" id="js_other_frame_box"></iframe>');
                break;
            default:
                html.push('<div class="frame-main" id="js_frame_box">' + _left_menu_html + '<div class="col-frame"><iframe src="'+URL_CTL.GetCacheMainURL()+'" frameborder="0" id="js_iframe_list"></iframe></div></div>');
                html.push('<iframe src="" frameborder="0" id="js_add_frame_box" style="display:none;" not_url="1"></iframe>');
                html.push('<iframe src="" frameborder="0" id="js_other_frame_box" not_url="1" style="display:none;"></iframe>');
                break;
        }
 
        document.write(html.join(""));
    </script>

</div>

<div id="js_jplay_box" style="position:absolute; top:-999999px;"></div>

<script type="text/javascript">
var userTabSetting = {
    Title: $("#js_user_tab"),
    Content: $("#js_user_con"),
    IsOverShow: true,
    ShowHandler: function(){
        userTabSetting.Title.parent().addClass("focus");
        msgTabSetting.Content.hide();
        msgTabSetting.Title.removeAttr("hide_state");
        msgTabSetting.Title.parent().removeClass("focus");

    },
    HideHandler: function(){
        userTabSetting.Title.parent().removeClass("focus");
    }
};
var msgTabSetting = {
    Title: $("#js_msg_tab"),
    Content: $("#js_msg_con"),
    IsOverShow: true,
    ShowHandler: function(){
        msgTabSetting.Title.parent().addClass("focus");
        userTabSetting.Content.hide();
        userTabSetting.Title.removeAttr("hide_state");
        userTabSetting.Title.parent().removeClass("focus");
        if(window["TopPageMsgFB"]){
            TopPageMsgFB.hide();
        }
    },
    HideHandler: function(){
        msgTabSetting.Title.parent().removeClass("focus");
    }
};
Util.DropDown.Bind(userTabSetting);
Util.DropDown.Bind(msgTabSetting);

</script>

<script type="text/javascript">
Core.Upload.SetConfig(UPLOAD_CONFIG);
if(Core.CONFIG.IsWindows){
    Core.Upload.WriteOCX(); //载入上传控件
}
else{
    Core.Upload.TUpLoadError();
}

Core.SpaceData.SetData(SPACE_DATA); //设置空间数据


if(MainDefaultTab != ""){
    if($("#js_frame_nav_top [t='"+MainDefaultTab+"']").length){
        URL_CTL._selectTab(MainDefaultTab);
    }
    else{
        URL_CTL._selectTab('u');
    }
}
else{
    URL_CTL._selectTab('u');
}

$("#js_other_frame_box").bind("load", function(){
    try{
        //TopPageListenMsg();
        
        URL_CTL.OtherChange(this.contentWindow.location);
    }catch(e){}
}).bind("readystatechange", function(){
    if(this.readyState == "complete"){
        try{
            //TopPageListenMsg();
            URL_CTL.OtherChange(this.contentWindow.location);
        }catch(e){}
    }
})
</script>
        
<script type="text/javascript">
var TopPageMsgDDS = $("#js_msg_con b[rel]");
var TopPageMsgFB, TopPageMsgFB_Show = true;
var TopPageListenMsg = function(){
    $.getScript(Core.CONFIG.Path.Msg + "?ac=unread&js_return=API_UNREAD_COUNT&_t=" + new Date().getTime(), function(){
        if(window["API_UNREAD_COUNT"]){
            var r = window["API_UNREAD_COUNT"];
            var total = 0;
            TopPageMsgDDS.each(function(){
                var rel = $(this).attr("rel");
                var count = r[rel];
                var ele = $(this);
                ele.html(count);
                if(count){
                    ele.parents("li").show();
                }
                else{
                    ele.parents("li").hide();
                }
                total += Number(count);
            })
            if(total > 0){
                $("#js_msg_con_total").html("(" + total + ")");
                if(TopPageMsgFB_Show){
                    if(!TopPageMsgFB){
                        TopPageMsgFB = $('<dl class="pull-down popup-remind" style="display:none;right:50px;z-index:98;">' + 
                                            '<dt><span>消息提醒</span><a href="javascript:;" class="close" rel="close">关闭</a></dt>'+
                                            '<dd>'+
                                                '<ul>'+
                                                    '<li><a href="http://msg.miniyun.com" target="_blank"><i class="icon ico-msg"></i><b rel="inbox">0</b>条未读消息</a></li>'+
                            '<li><a href="http://msg.miniyun.com/?c=active&app=u" target="_blank"><i class="icon ico-msg"></i><b rel="u">0</b>条续期提醒</a></li>'+
                            '<li><a href="http://msg.miniyun.com/?c=active&app=im" target="_blank"><i class="icon ico-msg"></i><b rel="im">0</b>条好友申请</a></li>'+
                            '<li><a href="http://msg.miniyun.com/?c=active&app=g" target="_blank"><i class="icon ico-msg"></i><b rel="g">0</b>条圈子消息</a></li>'+
                            '<li><a href="http://msg.miniyun.com/?c=active&app=wan" target="_blank"><i class="icon ico-msg"></i><b rel="wan">0</b>条游戏消息</a></li>'+

                            '<li><a href="http://msg.miniyun.com/?c=notice&type=51" target="_blank"><i class="icon ico-msg"></i><b rel="notice">0</b>条系统公告</a></li>'+
                                                '</ul>'+
                                            '</dd>'+
                                        '</dl>');
                        $(document.body).append(TopPageMsgFB);
                        
                        TopPageMsgFB.fadeIn("slow");
                        TopPageMsgFB.find("[rel='close']").bind("click", function(){
                            TopPageMsgFB.hide();
                            TopPageMsgFB_Show = false;
                            $("#js_no_msg_tab").hide();
                            $("#js_has_msg_tab").show();
                            return false;
                        })
                    }
                    if(TopPageMsgFB){
                        TopPageMsgFB.find("b[rel]").each(function(){
                            var rel = $(this).attr("rel");
                            var count = r[rel];
                            var ele = $(this);
                            ele.html(count);
                            if(count){
                                ele.parents("li").show();
                            }
                            else{
                                ele.parents("li").hide();
                            }
                        });
                    }
                    $("#js_no_msg_tab").hide();
                    $("#js_has_msg_tab").show();
                }
                else{
                    
                    $("#js_no_msg_tab").hide();
                    $("#js_has_msg_tab").show();
                }
            }
            else{
                if(TopPageMsgFB){TopPageMsgFB.hide();}
                $("#js_no_msg_tab").show();
                $("#js_has_msg_tab").hide();
                $("#js_msg_con_total").html("");
            }
        }
    })
}

var StartSyncCount = function(){
    var timer = window.setTimeout(function(){
        if(Core && Core.CountSync){
            if(timer){
                window.clearTimeout(timer);
            }
            try{
            Core.CountSync.Bind({
                html: function(count){
                    //回收站数量
                    if(count){
                        if(count > 99){
                            count = "99+";
                        }
                        $("#js_recycle_count").html(count).show();
                    }
                    else{
                        $("#js_recycle_count").html("").hide();
                    }
                }
            })
            Core.CountSync.Sync();
            }catch(e){}
        }
        else{
            StartSyncCount();
        }
    },50);
}
$(document).ready(function(){
    //TopPageListenMsg();
    TreeCTL.Init();
    StartSyncCount();
    if(window.location.hash.replace("#","") == "help"){
        Ext.Home.NewUser();    
        window.location.hash = "";
    }
});
</script>
</body>
</html>